/*
 * @Description: Table Props定义
 * @Author: seadon
 * @LastEditors: seadon
 * @Date: 2021-03-29 09:49:25
 * @LastEditTime: 2021-08-02 09:56:56
 */
import { PropType } from 'vue'
import PropTypes from '@/types/vue-type'
import { BasicColumn, PaginationProps } from './types'

export const basicProps = {
	instance: {
		type: Object,
	},
	dataSource: {
		type: [Array, String],
		default: () => [],
	},
	columns: {
		type: [Array] as PropType<BasicColumn[]>,
		default: () => [],
	},
	loading: {
		type: Boolean,
	},
	pagination: {
		type: [Object, Boolean] as PropType<PaginationProps | boolean>,
	},
	scroll: {
		type: Object as PropType<{
			x?: number | string | true
			y?: number | string
		}>,
	},
	rowKey: {
		type: [String, Function] as PropType<
			string | ((record: Recordable) => string)
		>,
		default: '',
	},
	fixedPagination: { type: Boolean },
	onEditChange: PropTypes.func,
	onEditEnd: PropTypes.func,
	onEditCancel: PropTypes.func,
	onEditRowEnd: PropTypes.func,
	onHeaderChange: PropTypes.func,
}
